<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./003.css">
</head>

<body>
    <div class="header">
        <div class="nav">
            <h4 class="h4">医院管理系统</h4>
            <div class="nav_center">
                <span>首页</span>
                <span>商品管理</span>
                <span>用户</span>
                <span>其他系统</span>
                <span class="gr" onclick="one()">个人中心
                    <div class="jianjie"></div>
                </span>
            </div>
            <div class="userinfo">
                <span>杨飞</span>
                <span>注销</span>
                <button class="xg">修改密码</button>
            </div>
        </div>
    </div>
    <div class="left_nav">
        <div class="left_nav_araticle">
            <div class="nav_araticle">
                <ul class="araticle_1">
                    <li>药品库存管理</li>
                    <li>登记出入库信息</li>
                    <li>问题药品记录</li>
                    <li>药品保质期检查</li>
                    <li>药品销售管理</li>
                    <li>销售记录</li>
                    <li>商品退货</li>
                    <li>药品明细查询</li>
                    <li>药品信息</li>
                    <li>供应商信息</li>
                    <li>退货给供应商</li>
                    <li>账单信息</li>
                </ul>
            </div>

        </div>
        <div class="araticcle">
            <div class="lunbotu">
                <img src="./beijing.png" alt="">
            </div>
            <div class="xiugai">

                手机号：<input type="text" id="phone">
                旧密码：<input type="text" id="oldpassword">
                新密码： <input type="text" id="newPassword">
                确认密码：<input type="text" id="confirmPassword">
                <button id="tijiaoyi">提交</button>
            </div>
            <div></div>
        </div>
    </div>
    <script src="./jquery-3.7.1(2).js"></script>
    <script>
        var user = JSON.parse(localStorage.getItem("ueradd"))
        console.log(user);
        var username = "",
            username = `
                    <span>手机号：${user.data.phone}</span>
                    <span>密码：${user.data.password}</span>
                    <span>用户名${user.data.username}</span>
                    <span>身份证号：${user.data.idCode}</span>
                    <span>邮箱：${user.data.email}</span>
                    <span>性别：${user.data.sex}</sapn> `
        $(".jianjie").append(username)

        $("#tijiaoyi").click(function () {
            $.ajax({
                url: "http://172.16.106.87:8080/updataPwd",
                type: "get",
                data: {
                    phone: $("#phone").val(),
                    oldpassword: $("#oldpassword").val(),
                    newPassword: $("#newPassword").val(),
                    confirmPassword: $("#confirmPassword").val(),
                },
                success:function(res) {
                    alert(res.message)
                }
            })




        })
    </script>
</body>

</html>